package org.example.myEnum;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@AllArgsConstructor
public enum ErrorCode {
    // 通用错误
    SUCCESS(200, "操作成功"),
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "无权限访问"),
    USER_NOT_FOUND(404, "用户不存在"),
    USERNAME_PASSWORD_WRONG(401, "用户名或密码错误"),
    SYSTEM_ERROR(500, "系统内部错误"),
    
    // JWT相关错误
    TOKEN_NOT_FOUND(401, "未提供token"),
    TOKEN_INVALID(401, "token无效"),
    TOKEN_OUT_OF_TIME(401, "token已过期"),
    
    // 业务错误
    ORDER_PAID(1002, "订单已支付"),

    TO_LARGER_PICTURE(1003,"上传图片尺寸过大"),
    PAY_FAIL(1004, "支付失败"),

    FAIL_GET_POST(1005,"获取帖子失败"),
    PARAMS_ERROR(1006,"上传文件不能为空");

    //图片尺寸过大

    
    private final int code;
    private final String message;
}